package com.expressage.service.impl;

import com.expressage.dao.FlowDao;
import com.expressage.po.Flow;
import com.expressage.service.FlowService;
import com.expressage.vo.FlowVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.Timestamp;
import java.util.List;

/**
 * 物流业务逻辑实现
 */
@Service("flowService")
public class FlowServiceImpl implements FlowService {
    @Autowired
    FlowDao flowDao;
    @Override
    public List<FlowVO> findAll() {
        return flowDao.findAll();
    }
    @Override
    public List<FlowVO> findBypid(int pid) {
        return flowDao.findBypid(pid);
    }

    @Override
    public FlowVO findByflowid(int flowid) {
        return flowDao.findByflowid(flowid);
    }

    @Override
    public List<FlowVO> findByodd(String odd) {
        return flowDao.findByodd(odd);
    }
    @Override
    public List<FlowVO> findBysiteid(int siteid) {
        return flowDao.findBysiteid(siteid);
    }
    @Override
    public List<FlowVO> findBystaffid(int staffid) {
        return flowDao.findBystaffid(staffid);
    }
    @Override
    public boolean insert(Flow flow) {
        flow.setDate(new Timestamp(System.currentTimeMillis()));//当前时间
        return flowDao.insert(flow) > 0?true:false;
    }
    @Override
    public boolean delete(int[] arrays) {
        return flowDao.delete(arrays) > 0?true:false;
    }
    @Override
    public boolean update(Flow flow) {
        return flowDao.update(flow) > 0?true:false;
    }
}
